package org.wjw.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.wjw.sys.domain.Dictionary;
import org.wjw.sys.mapper.DictionaryitemMapper;
import org.wjw.sys.service.IDictionaryService;
import org.wjw.base.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangjiawei
 * @since 2023-03-13
 */
@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class DictionaryServiceImpl extends BaseServiceImpl<Dictionary> implements IDictionaryService {
@Autowired
    DictionaryitemMapper dictionaryitemMapper;

    @Override
    @Transactional
    public void deleteById(Serializable id) {
        dictionaryitemMapper.deleteByparentId(id);
        super.deleteById(id);

    }
    @Override
    @Transactional
    public void batchDelete(List<Long> ids) {
        dictionaryitemMapper.batchDeleteByparentId(ids);
        super.batchDelete(ids);
    }


}
